"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const camelcase = require("camelcase");
/** 延迟多少时间
 * @param {number} millisecond
 */
function delay(millisecond = 800) {
    return new Promise(resolve => setTimeout(() => resolve(), millisecond));
}
exports.delay = delay;
function toCamel(o) {
    var newO, origKey, newKey, value;
    if (o instanceof Array) {
        newO = [];
        for (value of o) {
            if (typeof value === "object") {
                value = toCamel(value);
            }
            newO.push(value);
        }
    }
    else {
        newO = {};
        for (origKey in o) {
            if (o.hasOwnProperty(origKey)) {
                newKey = camelcase(origKey);
                value = o[origKey];
                if (value instanceof Array || (value !== null && value.constructor === Object)) {
                    value = toCamel(value);
                }
                newO[newKey] = value;
            }
        }
    }
    return newO;
}
exports.toCamel = toCamel;
